all: goget generalhandler scanlineep store crawler portmap \
	subdomainfilter urluniq restapi

goget:
	go get -v github.com/nsqio/go-nsq \
		github.com/bitly/go-simplejson \
		github.com/wangthomas/gobloomfield/client \
		gopkg.in/mgo.v2 \
		github.com/basgys/goxml2json \
		github.com/kataras/iris \
		github.com/satori/go.uuid \
		github.com/lifei6671/gocaptcha \
		github.com/dgrijalva/jwt-go \
	    	github.com/go-redis/redis

generalhandler:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/generalhandler general.go
	cp -fv bin/generalhandler bin/docker/pas_dnsenum/
	cp -fv bin/generalhandler bin/docker/pas_githubscan/
	cp -fv bin/generalhandler bin/docker/pas_MaiInt/MaiInt/
	cp -fv bin/generalhandler bin/docker/pas_theHarvester/theHarvester/
	cp -fv bin/generalhandler bin/docker/vuln_cmswebscan/webscan/
	cp -fv bin/generalhandler bin/docker/pas_sehack/
	cp -fv bin/generalhandler bin/docker/pas_whois/
	cp -fv bin/generalhandler bin/docker/pos_nmap/
	cp -fv bin/generalhandler bin/docker/pos_nmap_whole/
	cp -fv bin/generalhandler bin/docker/pos_subdomainbrute/subDomainsBrute/
	cp -fv bin/generalhandler bin/docker/vuln_dirsearch/dirsearch/
	cp -fv bin/generalhandler bin/docker/vuln_xss/DSXS/
	cp -fv bin/generalhandler bin/docker/vuln_hydra/pycallmedusa/
	cp -fv bin/generalhandler bin/docker/vuln_sqli/DSSS/

scanlineep:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/scanlineep scanlineep.go
	cp -fv bin/scanlineep bin/docker/scanlineep/

store:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/store store.go
	cp -fv bin/store bin/docker/store/

redis:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/redis redis.go
	cp -fv bin/redis bin/docker/pos_redis/

crawler:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/crawler crawler.go
	cp -fv bin/crawler bin/docker/pos_crawler/

portmap:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/portmap portmap.go
	cp -fv bin/portmap bin/docker/portmap/

subdomainfilter:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/subdomainfilter subdomainfilter.go
	cp -fv bin/subdomainfilter bin/docker/subdomainfilter/

urluniq:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/urluniq urluniq.go
	cp -fv bin/urluniq bin/docker/urluniq/

restapi:
	[[ -d bin/ ]] || mkdir bin/
	go build -o bin/restapi restapi.go
	cp -fv bin/restapi bin/docker/restapi/

clean:
	find -type f -name generalhandler | xargs rm -fv
	find -type f -name scanlineep | xargs rm -fv
	find -type f -name store | xargs rm -fv
	find -type f -name crawler | xargs rm -fv
	find -type f -name portmap | xargs rm -fv
	find -type f -name subdomainfilter | xargs rm -fv
	find -type f -name urluniq | xargs rm -fv
	find -type f -name restapi | xargs rm -fv
